# Function create_list_df
# creates a dataframe with response data and treatment indicator
# from the distribution of answers under control and under treatment
# to be used as inputs for function "ictreg" and "ict.test" in R package "list"
create_list_df <- function(dist_control, dist_treated, J) {
  y <- vector()
  for (i in 0:J) { y <- c(y, rep(i, dist_control[i+1])) }
  for (i in 0:(J+1)) { y <- c(y, rep(i, dist_treated[i+1])) }
  treat <- c(rep(0, sum(dist_control)), rep(1, sum(dist_treated)))
  list_df <- data.frame(y = y, treat = treat)
}
